package com.zkthink.ceres.tenant.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableName;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import com.zkthink.base.entity.Entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.validator.constraints.Length;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;

import static com.baomidou.mybatisplus.annotation.SqlCondition.EQUAL;
import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;
import static com.zkthink.utils.DateUtils.DEFAULT_DATE_TIME_FORMAT;

/**
 * <p>
 * 实体类
 * 商家入驻
 * </p>
 *
 * @author vivi.huang
 * @since 2020-06-29
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("ceres_tenant_apply")
@ApiModel(value = "TenantApply", description = "商家入驻")
@AllArgsConstructor
public class TenantApply extends Entity<Long> {

    private static final long serialVersionUID = 1L;

    /**
     * 主体类型 1：个人,2:个体工商户,3:企业,4:其他组织
     */
    @ApiModelProperty(value = "主体类型 1：个人,2:个体工商户,3:企业,4:其他组织")
    @Length(max = 10, message = "主体类型 1：个人,2:个体工商户,3:企业,4:其他组织:其他组织长度不能超过10")
    @TableField(value = "organization_type", condition = LIKE)
    @Excel(name = "主体类型 1：个人,2:个体工商户,3:企业,4:其他组织")
    private String organizationType;

    /**
     * 店铺名称
     */
    @ApiModelProperty(value = "店铺名称")
    @Length(max = 250, message = "店铺名称长度不能超过250")
    @TableField(value = "store_name", condition = LIKE)
    @Excel(name = "店铺名称")
    private String storeName;

    /**
     * 客服电话
     */
    @ApiModelProperty(value = "客服电话")
    @Length(max = 250, message = "客服电话长度不能超过250")
    @TableField(value = "customer_phone", condition = LIKE)
    @Excel(name = "客服电话")
    private String customerPhone;

    /**
     * 店铺负责人
     */
    @ApiModelProperty(value = "店铺负责人")
    @Length(max = 250, message = "店铺负责人长度不能超过250")
    @TableField(value = "store_head", condition = LIKE)
    @Excel(name = "店铺负责人")
    private String storeHead;

    /**
     * 负责人电话
     */
    @ApiModelProperty(value = "负责人电话")
    @Length(max = 250, message = "负责人电话长度不能超过250")
    @TableField(value = "head_mobile", condition = LIKE)
    @Excel(name = "负责人电话")
    private String headMobile;

    /**
     * 店铺地址(详细)
     */
    @ApiModelProperty(value = "店铺地址(详细)")
    @Length(max = 250, message = "店铺地址(详细)长度不能超过250")
    @TableField(value = "store_address_detail", condition = LIKE)
    @Excel(name = "店铺地址(详细)")
    private String storeAddressDetail;

    /**
     * 店铺地址(省)
     */
    @ApiModelProperty(value = "店铺地址(省)")
    @Length(max = 250, message = "店铺地址(省)长度不能超过250")
    @TableField(value = "store_address_province", condition = LIKE)
    @Excel(name = "店铺地址(省)")
    private String storeAddressProvince;

    /**
     * 店铺地址(城市)
     */
    @ApiModelProperty(value = "店铺地址(城市)")
    @Length(max = 250, message = "店铺地址(城市)长度不能超过250")
    @TableField(value = "store_address_city", condition = LIKE)
    @Excel(name = "店铺地址(城市)")
    private String storeAddressCity;

    /**
     * 经营者姓名
     */
    @ApiModelProperty(value = "经营者姓名")
    @Length(max = 250, message = "经营者姓名长度不能超过250")
    @TableField(value = "legal_person", condition = LIKE)
    @Excel(name = "经营者姓名")
    private String legalPerson;

    /**
     * 证件类型
     */
    @ApiModelProperty(value = "证件类型 1:中国大陆居民身份证 2：中国香港居民来往内地通行证 3：中国澳门居民来往内地通行证 4：中国台湾居民来往大陆通行证 5：其他国家与地区居民护照")
    @Length(max = 250, message = "证件类型长度不能超过250")
    @TableField(value = "id_doc_type", condition = LIKE)
    @Excel(name = "证件类型")
    private String idDocType;

    /**
     * 身份证号码
     */
    @ApiModelProperty(value = "身份证号码")
    @Length(max = 250, message = "身份证号码长度不能超过250")
    @TableField(value = "id_card_number", condition = LIKE)
    @Excel(name = "身份证号码")
    private String idCardNumber;

    /**
     * 身份证有效期限(开始)
     */
    @ApiModelProperty(value = "身份证有效期限(开始)")
    @Length(max = 250, message = "身份证有效期限(开始)长度不能超过250")
    @TableField(value = "id_card_valid_time_start", condition = LIKE)
    @Excel(name = "身份证有效期限(开始)")
    private String idCardValidTimeStart;

    /**
     * 身份证有效期限(结束)
     */
    @ApiModelProperty(value = "身份证有效期限(结束)")
    @Length(max = 250, message = "身份证有效期限(结束)长度不能超过250")
    @TableField(value = "id_card_valid_time_end", condition = LIKE)
    @Excel(name = "身份证有效期限(结束)")
    private String idCardValidTimeEnd;

    /**
     * 证件照片正面照
     */
    @ApiModelProperty(value = "证件照片正面照")
    @Length(max = 250, message = "证件照片正面照长度不能超过250")
    @TableField(value = "id_card_copy", condition = LIKE)
    @Excel(name = "证件照片正面照")
    private String idCardCopy;

    /**
     * 证件照片正面照文件路径
     */
    @ApiModelProperty(value = "证件照片正面照文件路径")
    @Length(max = 250, message = "证件照片正面照文件路径长度不能超过250")
    @TableField(value = "id_card_copy_file_path", condition = LIKE)
    @Excel(name = "证件照片正面照文件路径")
    private String idCardCopyFilePath;

    /**
     * 证件照片国徽面照片
     */
    @ApiModelProperty(value = "证件照片国徽面照片")
    @Length(max = 250, message = "证件照片国徽面照片长度不能超过250")
    @TableField(value = "id_card_national", condition = LIKE)
    @Excel(name = "证件照片国徽面照片")
    private String idCardNational;

    /**
     * 证件照片国徽面照片文件路径
     */
    @ApiModelProperty(value = "证件照片国徽面照片文件路径")
    @Length(max = 250, message = "证件照片国徽面照片文件路径长度不能超过250")
    @TableField(value = "id_card_national_file_path", condition = LIKE)
    @Excel(name = "证件照片国徽面照片文件路径")
    private String idCardNationalFilePath;

    /**
     * 手持证件照
     */
    @ApiModelProperty(value = "手持证件照")
    @Length(max = 250, message = "手持证件照长度不能超过250")
    @TableField(value = "hand_hold_card", condition = LIKE)
    @Excel(name = "手持证件照")
    private String handHoldCard;

    /**
     * 手持证件照文件路径
     */
    @ApiModelProperty(value = "手持证件照文件路径")
    @Length(max = 250, message = "手持证件照文件路径长度不能超过250")
    @TableField(value = "hand_hold_card_path", condition = LIKE)
    @Excel(name = "手持证件照文件路径")
    private String handHoldCardPath;

    /**
     * 商户名称/企业名称/组织名称
     */
    @ApiModelProperty(value = "商户名称/企业名称/组织名称")
    @Length(max = 250, message = "商户名称/企业名称/组织名称长度不能超过250")
    @TableField(value = "merchant_name", condition = LIKE)
    @Excel(name = "商户名称/企业名称/组织名称")
    private String merchantName;

    /**
     * 统一社会信用代码/组织机构代码
     */
    @ApiModelProperty(value = "统一社会信用代码/组织机构代码")
    @Length(max = 250, message = "统一社会信用代码/组织机构代码长度不能超过250")
    @TableField(value = "social_credit_code", condition = LIKE)
    @Excel(name = "统一社会信用代码/组织机构代码")
    private String socialCreditCode;

    /**
     * 注册地址
     */
    @ApiModelProperty(value = "注册地址")
    @Length(max = 250, message = "注册地址长度不能超过250")
    @TableField(value = "company_address", condition = LIKE)
    @Excel(name = "注册地址")
    private String companyAddress;

    /**
     * 注册地址(省)
     */
    @ApiModelProperty(value = "注册地址(省)")
    @Length(max = 250, message = "注册地址(省)长度不能超过250")
    @TableField(value = "company_address_province", condition = LIKE)
    @Excel(name = "注册地址(省)")
    private String companyAddressProvince;

    /**
     * 注册地址(市)
     */
    @ApiModelProperty(value = "注册地址(市)")
    @Length(max = 250, message = "注册地址(市)长度不能超过250")
    @TableField(value = "company_address_city", condition = LIKE)
    @Excel(name = "注册地址(市)")
    private String companyAddressCity;

    /**
     * 注册地址(区)
     */
    @ApiModelProperty(value = "注册地址(区)")
    @Length(max = 250, message = "注册地址(区)长度不能超过250")
    @TableField(value = "company_address_district", condition = LIKE)
    @Excel(name = "注册地址(区)")
    private String companyAddressDistrict;

    /**
     * 营业期限(开始)
     */
    @ApiModelProperty(value = "营业期限(开始)")
    @Length(max = 250, message = "营业期限(开始)长度不能超过250")
    @TableField(value = "business_time_start", condition = LIKE)
    @Excel(name = "营业期限(开始)")
    private String businessTimeStart;

    /**
     * 营业期限(结束)
     */
    @ApiModelProperty(value = "营业期限(结束)")
    @Length(max = 250, message = "营业期限(结束)长度不能超过250")
    @TableField(value = "business_time_end", condition = LIKE)
    @Excel(name = "营业期限(结束)")
    private String businessTimeEnd;

    /**
     * 营业执照证件扫描件
     */
    @ApiModelProperty(value = "营业执照证件扫描件")
    @Length(max = 10, message = "营业执照证件扫描件长度不能超过10")
    @TableField(value = "business_license_copy", condition = LIKE)
    @Excel(name = "营业执照证件扫描件")
    private String businessLicenseCopy;

    /**
     * 证件扫描件 文件路径
     */
    @ApiModelProperty(value = "证件扫描件 文件路径")
    @Length(max = 250, message = "证件扫描件 文件路径长度不能超过250")
    @TableField(value = "business_license_copy_file_path", condition = LIKE)
    @Excel(name = "证件扫描件 文件路径")
    private String businessLicenseCopyFilePath;

    /**
     * 审核状态 1：待处理，2：已通过，3：已拒绝
     */
    @ApiModelProperty(value = "审核状态 1：待处理，2：已通过，3：已拒绝")
    @TableField("audit_state")
    @Excel(name = "审核状态 1：待处理，2：已通过，3：已拒绝")
    private Integer auditState;

    /**
     * 审核时间
     */
    @ApiModelProperty(value = "审核时间")
    @TableField("audit_time")
    @Excel(name = "审核时间", format = DEFAULT_DATE_TIME_FORMAT, width = 20)
    private LocalDateTime auditTime;

    /**
     * 申请时间
     */
    @ApiModelProperty(value = "申请时间")
    @TableField("apply_time")
    @Excel(name = "申请时间", format = DEFAULT_DATE_TIME_FORMAT, width = 20)
    private LocalDateTime applyTime;

    /**
     * 生效日期类型，1：即时生效，2：指定日期
     */
    @ApiModelProperty(value = "生效日期类型，1：即时生效，2：指定日期")
    @TableField("effect_date_type")
    @Excel(name = "生效日期类型，1：即时生效，2：指定日期")
    private Integer effectDateType;

    /**
     * 生效日期
     */
    @ApiModelProperty(value = "生效日期")
    @TableField("effect_time")
    @Excel(name = "生效日期", format = DEFAULT_DATE_TIME_FORMAT, width = 20)
    private LocalDateTime effectTime;

    /**
     * 生效时限(年)
     */
    @ApiModelProperty(value = "生效时限(年)")
    @TableField("effect_time_limit")
    @Excel(name = "生效时限(年)")
    private Integer effectTimeLimit;

    /**
     * 拒绝原因
     */
    @ApiModelProperty(value = "拒绝原因")
    @Length(max = 1000, message = "拒绝原因长度不能超过1000")
    @TableField(value = "reject_reason", condition = LIKE)
    @Excel(name = "拒绝原因")
    private String rejectReason;


    /**
     * 拒绝原因
     */
    @ApiModelProperty(value = "有效期类型 1:长期，2：定期")
    @Length(max = 5, message = "拒绝原因长度不能超过5")
    @TableField(value = "expiry_date_type", condition = EQUAL)
    @Excel(name = "有效期类型 1:长期，2：定期")
    private Integer expiryDateType;


    @Builder
    public TenantApply(Long id, Long createUser, LocalDateTime createTime, Long updateUser, LocalDateTime updateTime, 
                    String organizationType, String storeName, String customerPhone, String storeHead, String headMobile, 
                    String storeAddressDetail, String storeAddressProvince, String storeAddressCity, String legalPerson, String idDocType, String idCardNumber, 
                    String idCardValidTimeStart, String idCardValidTimeEnd, String idCardCopy, String idCardCopyFilePath, String idCardNational, String idCardNationalFilePath, 
                    String handHoldCard, String handHoldCardPath, String merchantName, String socialCreditCode, String companyAddress, String companyAddressProvince, 
                    String companyAddressCity, String companyAddressDistrict, String businessTimeStart, String businessTimeEnd, String businessLicenseCopy, String businessLicenseCopyFilePath, 
                    Integer auditState, LocalDateTime auditTime, LocalDateTime applyTime, Integer effectDateType, LocalDateTime effectTime, Integer effectTimeLimit, String rejectReason, Integer expiryDateType) {
        this.id = id;
        this.createUser = createUser;
        this.createTime = createTime;
        this.updateUser = updateUser;
        this.updateTime = updateTime;
        this.organizationType = organizationType;
        this.storeName = storeName;
        this.customerPhone = customerPhone;
        this.storeHead = storeHead;
        this.headMobile = headMobile;
        this.storeAddressDetail = storeAddressDetail;
        this.storeAddressProvince = storeAddressProvince;
        this.storeAddressCity = storeAddressCity;
        this.legalPerson = legalPerson;
        this.idDocType = idDocType;
        this.idCardNumber = idCardNumber;
        this.idCardValidTimeStart = idCardValidTimeStart;
        this.idCardValidTimeEnd = idCardValidTimeEnd;
        this.idCardCopy = idCardCopy;
        this.idCardCopyFilePath = idCardCopyFilePath;
        this.idCardNational = idCardNational;
        this.idCardNationalFilePath = idCardNationalFilePath;
        this.handHoldCard = handHoldCard;
        this.handHoldCardPath = handHoldCardPath;
        this.merchantName = merchantName;
        this.socialCreditCode = socialCreditCode;
        this.companyAddress = companyAddress;
        this.companyAddressProvince = companyAddressProvince;
        this.companyAddressCity = companyAddressCity;
        this.companyAddressDistrict = companyAddressDistrict;
        this.businessTimeStart = businessTimeStart;
        this.businessTimeEnd = businessTimeEnd;
        this.businessLicenseCopy = businessLicenseCopy;
        this.businessLicenseCopyFilePath = businessLicenseCopyFilePath;
        this.auditState = auditState;
        this.auditTime = auditTime;
        this.applyTime = applyTime;
        this.effectDateType = effectDateType;
        this.effectTime = effectTime;
        this.effectTimeLimit = effectTimeLimit;
        this.rejectReason = rejectReason;
        this.expiryDateType = expiryDateType;
    }

}
